.class public Lcom/bitauto/autoeasy/picture/PictureViewActivity;
.super Lcom/bitauto/autoeasy/BaseActivity;
.source "PictureViewActivity.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bitauto/autoeasy/picture/PictureViewActivity$SwipeDetector;
    }
.end annotation


# static fields
.field private static final DISTANCE_DIP:F = 16.0f

.field private static final PATH_DIP:F = 40.0f


# instance fields
.field cachedImage:Landroid/graphics/drawable/Drawable;

.field private current:I

.field private detector:Landroid/view/GestureDetector;

.field private imageList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;",
            ">;"
        }
    .end annotation
.end field

.field imageView1:Lcom/bitauto/autoeasy/widget/RemoteImageView;

.field imageView2:Lcom/bitauto/autoeasy/widget/RemoteImageView;

.field private inToLeft:Landroid/view/animation/Animation;

.field private inToRight:Landroid/view/animation/Animation;

.field private left:Landroid/widget/ImageButton;

.field private minScaledVelocity:I

.field private myFlipper:Landroid/widget/ViewFlipper;

.field private outToLeft:Landroid/view/animation/Animation;

.field private outToRight:Landroid/view/animation/Animation;

.field private right:Landroid/widget/ImageButton;

.field private tempCount:I

.field private title:Ljava/lang/String;

.field private total:I

.field view:[Lcom/bitauto/autoeasy/widget/RemoteImageView;


# direct methods
.method public constructor <init>()V
    .locals 4

    .prologue
    const/4 v3, 0x0

    .line 25
    invoke-direct {p0}, Lcom/bitauto/autoeasy/BaseActivity;-><init>()V

    .line 41
    const/4 v0, 0x2

    new-array v0, v0, [Lcom/bitauto/autoeasy/widget/RemoteImageView;

    iget-object v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->imageView1:Lcom/bitauto/autoeasy/widget/RemoteImageView;

    aput-object v1, v0, v3

    const/4 v1, 0x1

    iget-object v2, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->imageView2:Lcom/bitauto/autoeasy/widget/RemoteImageView;

    aput-object v2, v0, v1

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->view:[Lcom/bitauto/autoeasy/widget/RemoteImageView;

    .line 50
    iput v3, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->tempCount:I

    .line 25
    return-void
.end method

.method static synthetic access$0(Lcom/bitauto/autoeasy/picture/PictureViewActivity;)I
    .locals 1
    .parameter

    .prologue
    .line 31
    iget v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->minScaledVelocity:I

    return v0
.end method


# virtual methods
.method public getImage()V
    .locals 2

    .prologue
    .line 99
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->view:[Lcom/bitauto/autoeasy/widget/RemoteImageView;

    iget v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->tempCount:I

    rem-int/lit8 v1, v1, 0x2

    aget-object v0, v0, v1

    const v1, 0x7f020008

    invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/widget/RemoteImageView;->setDefaultImage(Ljava/lang/Integer;)V

    .line 100
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->view:[Lcom/bitauto/autoeasy/widget/RemoteImageView;

    iget v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->tempCount:I

    rem-int/lit8 v1, v1, 0x2

    aget-object v0, v0, v1

    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->plusURL()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/widget/RemoteImageView;->setImageUrl(Ljava/lang/String;)V

    .line 101
    iget v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->tempCount:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->tempCount:I

    .line 102
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setTitleProgressBar(Z)V

    .line 103
    return-void
.end method

.method public initView()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 69
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "position"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    iput v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    .line 70
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "total"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    iput v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->total:I

    .line 71
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "title"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->title:Ljava/lang/String;

    .line 73
    const v0, 0x7f030027

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setLayout(I)V

    .line 75
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setImageTitle()V

    .line 77
    const/high16 v0, 0x7f04

    invoke-static {p0, v0}, Landroid/view/animation/AnimationUtils;->loadAnimation(Landroid/content/Context;I)Landroid/view/animation/Animation;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->inToLeft:Landroid/view/animation/Animation;

    .line 78
    const v0, 0x7f040002

    invoke-static {p0, v0}, Landroid/view/animation/AnimationUtils;->loadAnimation(Landroid/content/Context;I)Landroid/view/animation/Animation;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->outToLeft:Landroid/view/animation/Animation;

    .line 79
    const v0, 0x7f040001

    invoke-static {p0, v0}, Landroid/view/animation/AnimationUtils;->loadAnimation(Landroid/content/Context;I)Landroid/view/animation/Animation;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->inToRight:Landroid/view/animation/Animation;

    .line 80
    const v0, 0x7f040003

    invoke-static {p0, v0}, Landroid/view/animation/AnimationUtils;->loadAnimation(Landroid/content/Context;I)Landroid/view/animation/Animation;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->outToRight:Landroid/view/animation/Animation;

    .line 82
    iget-object v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->view:[Lcom/bitauto/autoeasy/widget/RemoteImageView;

    const v0, 0x7f0b01bc

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/widget/RemoteImageView;

    aput-object v0, v1, v2

    .line 83
    iget-object v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->view:[Lcom/bitauto/autoeasy/widget/RemoteImageView;

    const/4 v2, 0x1

    const v0, 0x7f0b01bd

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/widget/RemoteImageView;

    aput-object v0, v1, v2

    .line 85
    invoke-static {p0}, Landroid/view/ViewConfiguration;->get(Landroid/content/Context;)Landroid/view/ViewConfiguration;

    move-result-object v0

    .line 86
    invoke-virtual {v0}, Landroid/view/ViewConfiguration;->getScaledMinimumFlingVelocity()I

    move-result v0

    .line 85
    iput v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->minScaledVelocity:I

    .line 88
    new-instance v0, Landroid/view/GestureDetector;

    new-instance v1, Lcom/bitauto/autoeasy/picture/PictureViewActivity$SwipeDetector;

    invoke-direct {v1, p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity$SwipeDetector;-><init>(Lcom/bitauto/autoeasy/picture/PictureViewActivity;)V

    invoke-direct {v0, v1}, Landroid/view/GestureDetector;-><init>(Landroid/view/GestureDetector$OnGestureListener;)V

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->detector:Landroid/view/GestureDetector;

    .line 89
    const v0, 0x7f0b01bb

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ViewFlipper;

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->myFlipper:Landroid/widget/ViewFlipper;

    .line 91
    const v0, 0x7f0b01bf

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageButton;

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->right:Landroid/widget/ImageButton;

    .line 92
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->right:Landroid/widget/ImageButton;

    invoke-virtual {v0, p0}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 93
    const v0, 0x7f0b01be

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageButton;

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->left:Landroid/widget/ImageButton;

    .line 94
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->left:Landroid/widget/ImageButton;

    invoke-virtual {v0, p0}, Landroid/widget/ImageButton;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 96
    return-void
.end method

.method public moveScreenLeft()V
    .locals 3

    .prologue
    const/4 v2, 0x1

    .line 115
    iget v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    iget v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->total:I

    sub-int/2addr v1, v2

    if-ge v0, v1, :cond_0

    .line 116
    iget v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    add-int/lit8 v0, v0, 0x1

    iput v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    .line 117
    invoke-virtual {p0, v2}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setTitleProgressBar(Z)V

    .line 118
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->getImage()V

    .line 119
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setImageTitle()V

    .line 120
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->myFlipper:Landroid/widget/ViewFlipper;

    iget-object v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->inToLeft:Landroid/view/animation/Animation;

    invoke-virtual {v0, v1}, Landroid/widget/ViewFlipper;->setInAnimation(Landroid/view/animation/Animation;)V

    .line 121
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->myFlipper:Landroid/widget/ViewFlipper;

    iget-object v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->outToLeft:Landroid/view/animation/Animation;

    invoke-virtual {v0, v1}, Landroid/widget/ViewFlipper;->setOutAnimation(Landroid/view/animation/Animation;)V

    .line 122
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->myFlipper:Landroid/widget/ViewFlipper;

    invoke-virtual {v0}, Landroid/widget/ViewFlipper;->showNext()V

    .line 126
    :goto_0
    return-void

    .line 124
    :cond_0
    const-string v0, "\u5df2\u7ecf\u662f\u6700\u540e\u4e00\u5f20"

    invoke-static {p0, v0}, Lcom/bitauto/autoeasy/tool/ToolBox;->showToast(Landroid/content/Context;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public moveScreenRight()V
    .locals 2

    .prologue
    .line 132
    iget v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    if-lez v0, :cond_0

    .line 133
    iget v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    const/4 v1, 0x1

    sub-int/2addr v0, v1

    iput v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    .line 134
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->getImage()V

    .line 135
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setImageTitle()V

    .line 136
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->myFlipper:Landroid/widget/ViewFlipper;

    iget-object v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->inToRight:Landroid/view/animation/Animation;

    invoke-virtual {v0, v1}, Landroid/widget/ViewFlipper;->setInAnimation(Landroid/view/animation/Animation;)V

    .line 137
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->myFlipper:Landroid/widget/ViewFlipper;

    iget-object v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->outToRight:Landroid/view/animation/Animation;

    invoke-virtual {v0, v1}, Landroid/widget/ViewFlipper;->setOutAnimation(Landroid/view/animation/Animation;)V

    .line 138
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->myFlipper:Landroid/widget/ViewFlipper;

    invoke-virtual {v0}, Landroid/widget/ViewFlipper;->showPrevious()V

    .line 142
    :goto_0
    return-void

    .line 140
    :cond_0
    const-string v0, "\u5df2\u7ecf\u662f\u7b2c\u4e00\u5f20"

    invoke-static {p0, v0}, Lcom/bitauto/autoeasy/tool/ToolBox;->showToast(Landroid/content/Context;Ljava/lang/String;)V

    goto :goto_0
.end method

.method public onClick(Landroid/view/View;)V
    .locals 1
    .parameter "v"

    .prologue
    .line 182
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 193
    :goto_0
    return-void

    .line 184
    :pswitch_0
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->moveScreenLeft()V

    goto :goto_0

    .line 187
    :pswitch_1
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->moveScreenRight()V

    goto :goto_0

    .line 182
    :pswitch_data_0
    .packed-switch 0x7f0b01be
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method public onCreate(Landroid/os/Bundle;)V
    .locals 1
    .parameter "savedInstanceState"

    .prologue
    .line 56
    invoke-super {p0, p1}, Lcom/bitauto/autoeasy/BaseActivity;->onCreate(Landroid/os/Bundle;)V

    .line 58
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->initView()V

    .line 60
    sget-object v0, Lcom/bitauto/autoeasy/picture/PictureActivity;->allList:Ljava/util/ArrayList;

    iput-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->imageList:Ljava/util/ArrayList;

    .line 61
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->imageList:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    .line 62
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setTitleProgressBar(Z)V

    .line 63
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->getImage()V

    .line 65
    :cond_0
    return-void
.end method

.method public onTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 1
    .parameter "event"

    .prologue
    .line 107
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->detector:Landroid/view/GestureDetector;

    invoke-virtual {v0, p1}, Landroid/view/GestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z

    .line 108
    const/4 v0, 0x1

    return v0
.end method

.method public plusURL()Ljava/lang/String;
    .locals 3

    .prologue
    .line 196
    iget-object v0, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->imageList:Ljava/util/ArrayList;

    iget v1, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;

    invoke-virtual {p0}, Lcom/bitauto/autoeasy/picture/PictureParser$ImageList;->getFileurl()Ljava/lang/String;

    move-result-object v0

    const-string v1, "{0}"

    const-string v2, "4"

    invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public setImageTitle()V
    .locals 3

    .prologue
    .line 204
    new-instance v1, Ljava/lang/StringBuilder;

    iget-object v2, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->title:Ljava/lang/String;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, "["

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->current:I

    add-int/lit8 v2, v2, 0x1

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "/"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget v2, p0, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->total:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "]"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 205
    .local v0, str:Ljava/lang/String;
    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/picture/PictureViewActivity;->setTitleContent(Ljava/lang/String;)V

    .line 207
    return-void
.end method
